/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package BO;

import DAO.StaticDAO;
import java.util.List;
import pojo.Static;
import ulti.DateUlti;

/**
 *
 * @author phong
 */
public class StaticBO {
    //<editor-fold defaultstate="collapsed" desc="Lấy danh sach SignLab cho admin">

    public static List<Static> getStatictLab(String status, String startDate, String endDate, String timeTableId) {
        if (startDate.trim().equals("") || endDate.trim().equals("")) {
            if (status.equals("All")) {
                if (timeTableId.equals("All")) {
                    return StaticDAO.getStatictLab();
                } else {
                    return StaticDAO.getStatictLab(timeTableId);
                }
            } else {
                if (timeTableId.equals("All")) {
                    return StaticDAO.getStatictLabUsed();
                } else {
                    return StaticDAO.getStatictLabUsed(timeTableId);
                }
            }
        } else {
            if (status.equals("All")) {
                if (timeTableId.equals("All")) {
                    return StaticDAO.getStatictLab(DateUlti.getDate(startDate), DateUlti.getDate(endDate));
                } else {
                    return StaticDAO.getStatictLab(DateUlti.getDate(startDate), DateUlti.getDate(endDate), timeTableId);
                }
            } else {
                if (timeTableId.equals("All")) {
                    return StaticDAO.getStatictLabUsed(DateUlti.getDate(startDate), DateUlti.getDate(endDate));
                } else {
                    return StaticDAO.getStatictLabUsed(DateUlti.getDate(startDate), DateUlti.getDate(endDate), timeTableId);
                }
            }
        }
    }
//</editor-fold>
}
